﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLK.Database.DALs;

namespace QLK.Database.BLLs
{
    public class CustomerBLL
    {
        private CustomerDAL dal;

        public CustomerBLL()
        {
            dal = new CustomerDAL();
        }

        public List<Customer> CustomerGetAll()
        {
            return dal.CustomerGetAll();
        }

        public Customer CustomerGetByID(int CusID)
        {
            if (CusID > 0)
                return dal.CustomerGetByID(CusID);
            return null;
        }

        public bool CustomerInsert(Customer Cust)
        {
            return dal.CustomerInsert(Cust);
        }

        public bool CustomerDeleteByID(int CusID)
        {
            return dal.CustomerDeleteByID(CusID);
        }

        public bool CustomerUpdate(Customer Cust)
        {
            return dal.CustomerUpdate(Cust);
        }

        public int CustomerGetIDByName(string CustName)
        {
            if (dal.CustomerCheckIsNull())
                return 0;
            else
                return dal.CustomerGetIDByName(CustName);
        }
    }
}
